<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01-vue使用步骤</title>
    <style>
        .father {
            width: 200px;
            height: 200px;
            background-color: pink;
            margin-top: 20px;
        }
        .son {
            width: 100px;
            height: 100px;
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div id="app">
        <h3>阻止冒泡</h3>
        <div class="father" @click="fn2">
            <div class="son" @click.stop="fn1"></div>
        </div>

        <h3>阻止a标签的点击默认跳转事件</h3>
        <a href="http://www.baidu.com" @click.prevent="fn3">点我啊</a>
    </div>

    <script src="js/vue.js"></script>
    <script>
         let app = new Vue({
             el: '#app',
             methods: {
                 fn1(){
                     console.log('子')
                 },
                 fn2(){
                     console.log('父')
                 },
                 fn3(){

                 }
             }
         })
    </script>

</body>
</html>